import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ChangeMasterTrialVO, ChangeMasterTrialForm, ChangeMasterTrialQuery } from '@/api/manu/changeMasterTrial/types';

/**
 * 查询变更主数据trial列表
 * @param query
 * @returns {*}
 */

export const listChangeMasterTrial = (query?: ChangeMasterTrialQuery): AxiosPromise<ChangeMasterTrialVO[]> => {
  return request({
    url: '/manu/changeMasterTrial/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询变更主数据trial详细
 * @param id
 */
export const getChangeMasterTrial = (id: string | number): AxiosPromise<ChangeMasterTrialVO> => {
  return request({
    url: '/manu/changeMasterTrial/' + id,
    method: 'get'
  });
};

/**
 * 新增变更主数据trial
 * @param data
 */
export const addChangeMasterTrial = (data: ChangeMasterTrialForm) => {
  return request({
    url: '/manu/changeMasterTrial',
    method: 'post',
    data: data
  });
};

/**
 * 修改变更主数据trial
 * @param data
 */
export const updateChangeMasterTrial = (data: ChangeMasterTrialForm) => {
  return request({
    url: '/manu/changeMasterTrial',
    method: 'put',
    data: data
  });
};

/**
 * 删除变更主数据trial
 * @param id
 */
export const delChangeMasterTrial = (id: string | number | Array<string | number>) => {
  return request({
    url: '/manu/changeMasterTrial/' + id,
    method: 'delete'
  });
};
